package com.sqtracker.recommender.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
@Document(collection = "user_preferences")
public class UserPreference {
    @Id
    private String id;
    private String userId;
    private ExplicitPreferences explicitPreferences;  // 用户显式设置的偏好
    private ImplicitPreferences implicitPreferences;  // 系统推断的隐式偏好
    private Date lastUpdated;

    @Data
    public static class ExplicitPreferences {
        private List<String> categories;
        private List<String> tags;
        private List<String> languages;
        private List<String> quality;
    }

    @Data
    public static class ImplicitPreferences {
        private Map<String, Double> categories;  // 类别:权重
        private Map<String, Double> tags;        // 标签:权重
        private Map<String, Double> languages;   // 语言:权重
        private Map<String, Double> publishers;  // 发布者:权重
    }
}